<!DOCTYPE html>
<html lang="en">
 <head> 
  <meta charset="utf-8" /> 
  <title>菜单管理</title> 
  <meta name="renderer" content="webkit" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
  <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
  <meta name="apple-mobile-web-app-capable" content="yes" /> 
  <meta name="format-detection" content="telephone=no" /> 
  <link rel="stylesheet" href="/assets/js/layui/css/layui.css" media="all" /> 
  <link rel="stylesheet" href="/assets/css/global.css" media="all" /> 
  <link rel="stylesheet" href="/assets/js/font-awesome/css/font-awesome.min.css" /> 
  <style type="text/css">
    .layui-form-item .layui-inline {
        width: 33.333%;
        float: left;
        margin-right: 0;
    }

    @media (max-width: 1240px) {
        .layui-form-item .layui-inline {
            width: 100%;
            float: none;
        }
    }
    .left-tree{
       display: inline-block;
        margin-left: 2px;
        width: 250px;
        height: 400px;
        padding: 10px;
        border: 1px solid #ddd;
        overflow: auto;
        background-color: #f2f2f2;
    }
    .rigth-content{
        display: inline-block;
        height: 400px;
        width: 600px;
        padding: 10px;
        margin-left: 10px;
        vertical-align: top;
    }
    .site-tips{
        margin-bottom: 10px;
        line-height: 22px;
        border-left: 5px solid #0078AD;
    }
</style>
 </head>  
 <body class="childrenBody"> 
  <div class="admin-main">  
   <fieldset class="layui-elem-field"> 
    <legend>组织架构管理</legend> 
    <div class="layui-field-box layui-form"> 
     <div class="left-tree"> 
      <ul id="tree_cont" class="layui-box layui-tree"></ul> 
     </div> 
     <div id="form_cont" class="site-tips rigth-content"> 
      <form id="dataform" class="layui-form" action=""> 
       <input type="hidden" name="id" bindattr="id" />  
       <div class="layui-form-item"> 
        <label class="layui-form-label">类型</label> 
        <div class="layui-input-block"> 
         <input type="text" class="layui-input" bindattr="type" style="background-color: #E8E8E8" readonly="readonly" /> 
        </div> 
       </div>
       <div class="layui-form-item"> 
        <label class="layui-form-label">名称</label> 
        <div class="layui-input-block"> 
         <input type="text" class="layui-input" bindattr="name" name="name" lay-verify="required" /> 
        </div> 
       </div> 
       
       <div class="layui-form-item company-filter"> 
        <label class="layui-form-label">地址</label> 
        <div class="layui-input-block"> 
         <input type="text" class="layui-input" bindattr="address" name="address" lay-verify="required" /> 
        </div> 
       </div> 
       
       <div class="layui-form-item"> 
        <label class="layui-form-label">联系电话</label> 
        <div class="layui-input-block"> 
         <input type="text" class="layui-input" bindattr="telephone" name="telephone" lay-verify="required" /> 
        </div> 
       </div>
       
       <div class="layui-form-item"> 
        <div class="layui-input-block"> 
         <input type="button" class="layui-btn layui-btn-normal J_ajaxSubmit" onsuccesscallback="reloadTree" value="保存" /> 
         <input id="add_branch_btn" type="button" class="layui-btn layui-btn-normal J_iframe_dialog" style="display: none;" data-url="/modules/organisation/branch-add.html" data-title="添加子公司" value="添加子公司" /> 
         <input id="add_depart_btn" type="button" class="layui-btn layui-btn-normal J_iframe_dialog" style="display: none;" data-url="/modules/organisation/department-add.html?companyId={id}" data-title="添加部门" value="添加部门" /> 
         <input type="button" class="layui-btn layui-btn-danger J_confirm" data-url="/company/delete/{id}" ajax-method="POST" onsuccesscallback="reloadTree" value="删除" /> 
        </div> 
       </div> 
      </form> 
     </div> 
    </div> 
   </fieldset> 
  </div> 
  <script type="text/javascript" src="/assets/js/layui/layui.js"></script> 
  <script>
  var moduleName = 'organisation';
   var actionType = 'structure';
	layui.config({
		version : "1.0.0",
		base : '/assets/js/modules/'
	}).use('organisation');
	
	function reloadTree(data){
		window.location.reload();
	}
</script>  
 </body>
</html>